<!DOCTYPE html> 
<html lang="en"> 
<head>
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title><{$Think.config.cfg_webname}></title> 
    <link href="__CSS__/base.css" rel="stylesheet">
    <link href="__CSS__/login/login.css" rel="stylesheet">
	<script src="__PUBLIC__/custom/jquery.min.js"></script>
</head> 
<body>
	<div class="login-hd">
		<div class="left-bg"></div>
		<div class="right-bg"></div>
		<div class="hd-inner">
			<span class="logo"></span>
			<!-- <span class="split"></span>
			<span class="sys-name"><{$Think.config.cfg_webname}></span> -->
		</div>
	</div>
	<div class="login-bd">
		<div class="bd-inner">
			<div class="inner-wrap">
				<div class="lg-zone">
					<div class="lg-box">
						<div class="lg-label"><h4>用户登录</h4></div>
						<div class="alert alert-error" id="checkmsgwrap">
			              <i class="iconfont">&#xe62e;</i>
			              <span id="checkmsg">请输入用户名</span>
			            </div>
						<form name="loginForm" id="loginForm">
							<div class="lg-username input-item clearfix">
								<i class="iconfont">&#xe60d;</i>
								<input type="text" name="username" id="username" placeholder="账号">
							</div>
							<div class="lg-password input-item clearfix">
								<i class="iconfont">&#xe634;</i>
								<input type="password" name="password" id="password" autocomplete="off" placeholder="密码">
							</div>
							<div class="lg-check clearfix">
								<div class="input-item">
									<i class="iconfont">&#xe633;</i>
									<input type="text" name="verification" id="verification" placeholder="验证码">
								</div>
								<span class="check-code"><img id="checkcode" src="__CONTROLLER__/verify" onclick="this.src='__CONTROLLER__/verify'" style="cursor: pointer;" title="点击获取"/></span>
							</div>
							<div class="tips clearfix">
								<label><input type="checkbox" checked="checked">记住用户名</label>
								<!-- <a href="javascript:;" class="forget-pwd">忘记密码？</a> -->
							</div>
							<div class="enter">
								<a href="javascript:;" class="supplier" id="loginBtn">管理员登录</a>
							</div>
						</form>
					</div>
				</div>
				<div class="lg-poster"></div>
			</div>
		</div>
	</div>
	<div class="login-ft">
		<div class="ft-inner">
			<div class="about-us">
				<a href="javascript:;">关于我们</a>
				<a href="javascript:;">法律声明</a>
				<a href="javascript:;">服务条款</a>
				<a href="javascript:;">联系方式</a>
			</div>
			<div class="address">地址：江苏省南京市雨花台区软件园&nbsp;邮编：210019&nbsp;&nbsp;Copyright&nbsp;©&nbsp;2015&nbsp;-&nbsp;2016&nbsp;uimaker-专注于ui设计&nbsp;版权所有</div>
			<div class="other-info">建议使用IE8及以上版本浏览器&nbsp;苏ICP备&nbsp;09003078号&nbsp;E-mail：admin@uimaker.com</div>
		</div>
	</div>
</body> 
</html>
    
<script type="text/javascript">

$(function(){
	var loginBtn = $("#loginBtn");
	var loginForm = $("#loginForm");
	
	$('body').keydown(function(e){
		if(e.keyCode == 13){
			dologin();
		}
	});
	
	loginBtn.on('click',function(){
		dologin();
	});
	
	var dologin = function(){
		if($("#username").val() == "")
		{
			$("#checkmsg").html('请输入用户名');
			$("#username").focus();
			return false;
		}
		if($("#password").val() == "")
		{
			$("#checkmsg").html('请输入密码');
			$("#password").focus();
			return false;
		}
		if($("#verification").val() == "")
		{
			$("#checkmsg").html('请输入验证码');
			$("#verification").focus();
			return false;
		}
		
		$("#checkmsg").html('正在登陆...');
		var param = loginForm  .serialize();
		$.ajax({
			url:"__CONTROLLER__/login",
			dataType:"json",
			data:param,
			type:'POST',
			success:function(data){
				if(data.success){
					$("#checkmsg").html('登陆成功');
					window.location.href = "__MODULE__/Index/index";
				}else{
					$("#checkmsg").html(data.error);
					$("#checkcode").click();
				}
			}
			
		});
	}
	
});
</script>
